package com.example.stu1.score.service;

import com.example.stu1.score.dao.ScoreMapper;
import com.example.stu1.score.pojo.Score;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;

@Service
public class ScoreService {
    @Resource
    private ScoreMapper mapper;

    public void addScore(Score score) {
        mapper.insert(score);
    }

    public ArrayList<Score> queryScore() {
        return mapper.query();
    }

    public void deleteScore(Score score) { mapper.delete(score); }

    public void updateScore(Integer score,Integer scId) { mapper.update(score,scId); }

    public Score getScore(Integer scId){
        return mapper.get(scId);
    }

    public ArrayList<Score> ScoreSno(Integer sno) {
        return mapper.query2(sno);
    }
    public ArrayList<Score> ScoreCno(Integer cno) {
        return mapper.query3(cno);
    }
    public ArrayList<Score> ScoreSc(Integer sno,Integer cno) {
        return mapper.query4(sno,cno);
    }
}
